← all projects

Shared pre-push hook with npm lint and repository hook support

Shared pre-push hook with npm lint and repository hook support
gist

Shared pre-push hook

This global Git hook:

Install

Save pre-push to your global Git hooks directory, then run:

chmod +x ~/.config/git/hooks/pre-push
git config --global core.hooksPath ~/.config/git/hooks

Composer repositories can define lint:pre-push when linting needs access to Git's pre-push ref data. Repositories can also provide other pre-push behavior in an executable .repo-hooks.sh file.